package com.example.hjt_java_web_homework3.model;

import java.util.Date;

/**
 * @author Li Chun Hei
 * @date 31/10/2025
 * @description
 */
public class Device {
    private Long id;
    private String name;
    private String type; // AIR_CONDITIONER, ELECTRIC_METER
    private String location;
    private String deviceId;
    private Boolean status = true;
    private Date createTime;
    private Date updateTime;

    // 构造方法
    public Device() {}

    public Device(String name, String type, String location, String deviceId) {
        this.name = name;
        this.type = type;
        this.location = location;
        this.deviceId = deviceId;
        this.status = true;
        this.createTime = new Date();
        this.updateTime = new Date();
    }

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) {
        this.name = name;
        this.updateTime = new Date();
    }
    public String getType() { return type; }
    public void setType(String type) { this.type = type; }
    public String getLocation() { return location; }
    public void setLocation(String location) {
        this.location = location;
        this.updateTime = new Date();
    }
    public String getDeviceId() { return deviceId; }
    public void setDeviceId(String deviceId) { this.deviceId = deviceId; }
    public Boolean getStatus() { return status; }
    public void setStatus(Boolean status) {
        this.status = status;
        this.updateTime = new Date();
    }
    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }
    public Date getUpdateTime() { return updateTime; }
    public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
}
